home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / Dictionary.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  4.2 KB  |  148 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Dictionary.p
  3.  
  4.      Contains:    Dictionary Manager Interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT Dictionary;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __DICTIONARY__}
  30. {$SETC __DICTIONARY__ := 1}
  31.  
  32. {$I+}
  33. {$SETC DictionaryIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __FILES__}
  43. {$I Files.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46. {    OSUtils.p                                                    }
  47. {        Memory.p                                                }
  48. {    Finder.p                                                    }
  49.  
  50. {$PUSH}
  51. {$ALIGN MAC68K}
  52. {$LibExport+}
  53.  
  54. CONST
  55. { Dictionary data insertion modes }
  56.     kInsert                        = 0;                            { Only insert the input entry if there is nothing in the dictionary that matches the key. }
  57.     kReplace                    = 1;                            { Only replace the entries which match the key with the input entry. }
  58.     kInsertOrReplace            = 2;                            { Insert the entry if there is nothing in the dictionary which matches the key. 
  59.                            If there is already matched entries, replace the existing matched entries with the input entry. }
  60.  
  61. { This Was InsertMode }
  62.     
  63. TYPE
  64.     DictionaryDataInsertMode = INTEGER;
  65.  
  66.  
  67. CONST
  68. { Key attribute constants }
  69.     kIsCaseSensitive            = $10;                            { case sensitive = 16        }
  70.     kIsNotDiacriticalSensitive    = $20;                            { diac not sensitive = 32    }
  71.  
  72. { Registered attribute type constants.    }
  73.     kNoun                        = -1;
  74.     kVerb                        = -2;
  75.     kAdjective                    = -3;
  76.     kAdverb                        = -4;
  77.  
  78. { This Was AttributeType }
  79.     
  80. TYPE
  81.     DictionaryEntryAttribute = SInt8;
  82.  
  83. { Dictionary information record }
  84.     DictionaryInformation = RECORD
  85.         dictionaryFSSpec:        FSSpec;
  86.         numberOfRecords:        SInt32;
  87.         currentGarbageSize:        SInt32;
  88.         script:                    ScriptCode;
  89.         maximumKeyLength:        SInt16;
  90.         keyAttributes:            SInt8;
  91.     END;
  92.  
  93.     DictionaryAttributeTable = PACKED RECORD
  94.         datSize:                UInt8;
  95.         datTable:                PACKED ARRAY [0..0] OF DictionaryEntryAttribute;
  96.     END;
  97.  
  98.     DictionaryAttributeTablePtr = ^DictionaryAttributeTable;
  99.  
  100.  
  101. FUNCTION InitializeDictionary({CONST}VAR theFsspecPtr: FSSpec; maximumKeyLength: SInt16; keyAttributes: ByteParameter; script: ScriptCode): OSErr;
  102.     {$IFC NOT GENERATINGCFM}
  103.     INLINE $303C, $0500, $AA53;
  104.     {$ENDC}
  105. FUNCTION OpenDictionary({CONST}VAR theFsspecPtr: FSSpec; accessPermission: ByteParameter; VAR dictionaryReference: SInt32): OSErr;
  106.     {$IFC NOT GENERATINGCFM}
  107.     INLINE $303C, $0501, $AA53;
  108.     {$ENDC}
  109. FUNCTION CloseDictionary(dictionaryReference: SInt32): OSErr;
  110.     {$IFC NOT GENERATINGCFM}
  111.     INLINE $303C, $0202, $AA53;
  112.     {$ENDC}
  113. FUNCTION InsertRecordToDictionary(dictionaryReference: SInt32; key: ConstStr255Param; recordDataHandle: Handle; whichMode: DictionaryDataInsertMode): OSErr;
  114.     {$IFC NOT GENERATINGCFM}
  115.     INLINE $303C, $0703, $AA53;
  116.     {$ENDC}
  117. FUNCTION DeleteRecordFromDictionary(dictionaryReference: SInt32; key: ConstStr255Param): OSErr;
  118.     {$IFC NOT GENERATINGCFM}
  119.     INLINE $303C, $0404, $AA53;
  120.     {$ENDC}
  121. FUNCTION FindRecordInDictionary(dictionaryReference: SInt32; key: ConstStr255Param; requestedAttributeTablePointer: DictionaryAttributeTablePtr; recordDataHandle: Handle): OSErr;
  122.     {$IFC NOT GENERATINGCFM}
  123.     INLINE $303C, $0805, $AA53;
  124.     {$ENDC}
  125. FUNCTION FindRecordByIndexInDictionary(dictionaryReference: SInt32; recordIndex: SInt32; requestedAttributeTablePointer: DictionaryAttributeTablePtr; VAR recordKey: Str255; recordDataHandle: Handle): OSErr;
  126.     {$IFC NOT GENERATINGCFM}
  127.     INLINE $303C, $0A06, $AA53;
  128.     {$ENDC}
  129. FUNCTION GetDictionaryInformation(dictionaryReference: SInt32; VAR theDictionaryInformation: DictionaryInformation): OSErr;
  130.     {$IFC NOT GENERATINGCFM}
  131.     INLINE $303C, $0407, $AA53;
  132.     {$ENDC}
  133. FUNCTION CompactDictionary(dictionaryReference: SInt32): OSErr;
  134.     {$IFC NOT GENERATINGCFM}
  135.     INLINE $303C, $0208, $AA53;
  136.     {$ENDC}
  137.  
  138. {$ALIGN RESET}
  139. {$POP}
  140.  
  141. {$SETC UsingIncludes := DictionaryIncludes}
  142.  
  143. {$ENDC} {__DICTIONARY__}
  144.  
  145. {$IFC NOT UsingIncludes}
  146.  END.
  147. {$ENDC}
  148.